{extend name='app' /}
{block name='title'}订单列表{/block}

{block name="stylesheet"}
{/block}


{block name="breadcrumb"}
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>订单列表</h2>
        <ol class="breadcrumb">
            <li class="breadcrumb-item">
                <a>订单管理</a>
            </li>
            <li class="breadcrumb-item active">
                <strong>订单列表</strong>
            </li>
        </ol>
    </div>
</div>
{/block}


{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">

                <form id="block-search">
                    <div class="row ">
                        <div class="col-sm-2">
                            <div class="form-group">
                                <label class="control-label">订单状态</label>
                                <select class="form-control m-b select-title" name="order_status">
                                    <option value="">全部</option>
                                    <option value="1" {if $search['order_status']==1} selected {/if}>待审核</option>
                                    <option value="2" {if $search['order_status']==2} selected {/if}>未通过</option>
                                    <option value="3" {if $search['order_status']==3} selected {/if}>已通过</option>
                                </select>
                            </div>
                        </div>

                        <div class="col-sm-2">
                            <div class="form-group">
                                <label class="control-label">订单编号</label>
                                <input placeholder="请输入订单编号查询" type="text" class="form-control" name="order_sn" value="{$search['order_sn']??''}">
                            </div>
                        </div>
                        <div class="col-sm-2">
                            <div class="form-group">
                                <label class="control-label">昵称</label>
                                <input placeholder="请输入昵称" type="text" class="form-control" name="nickname" value="{$search['nickname']??''}">
                            </div>
                        </div>

                        <div class="col-sm-2">
                            <div class="form-group">
                                <label class="control-label">项目</label>
                                <input placeholder="请输入项目" type="text" class="form-control" name="name" value="{$search['name']??''}">
                            </div>
                        </div>
                    </div>

                    <div class="row m-b-lg">
                        <div class="col-sm btn-group-search">
                            <button class="btn btn-primary btn-sm" type="submit">确定</button>
                            <button class="btn btn-white btn-sm btn-reset" type="button">重置</button>
                        </div>
                    </div>
                </form>

                <div class="ibox-title">
                    <div class="ibox-tools">
                        <span class="float-right btn-group">
                                 <button class="btn btn-white btn-sm btn-outline" type="button" onclick="export_file($('#block-search'),'{$Think.config.admin.app_host}/admin/order/export')"><i class="fa fa-download"></i>&nbsp;导出数据
                                </button>
                        </span>
                    </div>
                </div>

                <div class="ibox-content">
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>#</th>
                                <th>订单号</th>
                                <th>项目</th>
                                <th>用户昵称</th>
                                <th>订单积分</th>
                                <th>附加积分</th>
                                <th>客户名称</th>
                                <th>客户手机号</th>
                                <th>联系人</th>
                                <th>联系人地址</th>
                                <th>下单时间</th>
                                <th>订单状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {foreach $data as $index => $item}
                            <tr>
                                <td>{++$index}</td>
                                <td>{$item['order_sn']}</td>
                                <td>{$item['name']}</td>
                                <td>{$item['nickname']}</td>
                                <td>{$item['order_integral']}</td>
                                <td>{$item['add_integral']}</td>
                                <td>{$item['client_name']}</td>
                                <td>{$item['client_mobile']}</td>
                                <td>{$item['client_realname']}</td>
                                <td>{$item['client_address']}</td>
                                <td>{$item['create_time']}</td>
                                <td>
                                    {if($item['order_status']==1)}
                                        待审核
                                    {elseif($item['order_status']==2)}
                                        未通过
                                    {elseif($item['order_status']==3)}
                                        已同意
                                    {/if}
                                </td>
                                <td>

                                    <button class="btn badge-success btn-xs" type="button" onclick="window.location.href='{$Think.config.admin.app_host}/admin/order/{$item[\'id\']}/edit'">
                                        <i class="fa fa-times-circle"></i>&nbsp;项目反馈
                                    </button>

                                    <button class="btn btn-xs" type="button" onclick="get_html($(this),'{$Think.config.admin.app_host}/admin/order/integral?id={$item[\'id\']}')"><i class="fa fa-pencil"></i>&nbsp;附加积分
                                    </button>

                                    {if $item['order_status'] != 3}
                                        <button class="btn btn-primary btn-xs" type="button"
                                                onclick="operate_form($(this),'{$Think.config.admin.app_host}/admin/order/operate', {'order_id' : '{$item[\'id\']}','status':3})">
                                            <i class="fa fa-check-circle"></i>&nbsp;&nbsp;同意
                                        </button>

                                        {if $item['order_status'] != 2}
                                            <button class="btn btn-danger btn-xs" type="button"   onclick="operate_form($(this),'{$Think.config.admin.app_host}/admin/order/operate', {'order_id' : '{$item[\'id\']}','status':2})"><i class="fa fa-times-circle"></i>&nbsp;拒绝
                                            </button>
                                        {/if}
                                    {/if}
                                    <button class="btn btn-info btn-xs" type="button"
                                            onclick="window.location.href='{$Think.config.admin.app_host}/admin/order/{$item[\'id\']}'">
                                        <i class="fa fa-window-maximize"></i>&nbsp;&nbsp;查看详情
                                    </button>
                                </td>
                            </tr>
                            {/foreach}
                            </tbody>
                        </table>
                        <div class="float-right">
                            {$list|raw}
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>
{/block}

{block name="script"}
{/block}
